<?php
namespace app\serverfavorite\validate;
use \app\manage\validate\BaseValidate;

class FavoriteCategory extends BaseValidate
{
    
	protected $rule =   [
		'app_id'  => ['integer','gt'=>0],
        'id'=>['integer','gt'=>0],
        'pid'=>['integer','egt'=>0],
        'name'=>['length'=>'2,25'],
        'order'=>['integer','gt'=>0],
        'status'=> ['in'=>'0,1'],
        'is_public'=> ['in'=>'0,1'],
    ];

    protected $message  =   [
        'pid' => '父分类pid为大于等于0的整数',
        'name' => '分类名称的长度在2-25个字符之间',
        'order' => '排序order为大于0的整数',
        'status' => '选择启用或禁用',
    ];

    protected $scene = [
        'addCate' => [
            'pid','name','order','app_id','is_public'
        ],
        'editCate' => [
            'id'=>['require','integer','gt'=>0],'name','order','app_id','is_public'
        ],
        'oneCateInfo' => [
            'id','app_id'
        ],
        'delOneCate' => [
        	'id','app_id'
        ],
        'batchDelCate' => [
            'id'=>['require','array','min'=>1],'app_id'
        ],
        'cateList' => [
            'id'=>['integer','egt'=>0],'app_id'
        ],
        'changeStatus' => [
            'id','app_id','status'
        ],
        'batchChangeStatus' => [
            'id'=>['require','array','min'=>1],'app_id','status'
        ],

    ];

}